import { getLogsOfSuite } from './getData'
import { notify } from './notify'
import { NotifyType } from '../common/enums'
import { store } from '../stores/home'
import { genProgressSetActiveSuiteLogs } from '../actions/home'

export const doGetLogsOfSuite = ({ planId, suiteId }, opt) => {
    getLogsOfSuite({ planId, suiteId }, opt)
        .then(logs => store.dispatch(genProgressSetActiveSuiteLogs(logs)))
        .catch(err => notify(NotifyType.error, err))
}